tip = ('车次', '出发站', '到达站', '出发时间', '到达时间', '历时')
list = [('T40','长春','北京','00:12','12:20','12:08'),
        ('T298','长春','北京','00:06','10:50','10:44'),
        ('Z158','长春','北京','12:48','21:06','08:18'),
        ('Z62','长春','北京','21:58','06:08','8:20')]
def x (tip,list):
    print('{:<8}{}-{:<8}{:<8}{:<8}{}'.format(*tip))
    for i in list:
        print('{:<10}{}-{:<12}{:<12}{:<12}{}'.format(*i))
while 1:
    print('当前的火车信息：')
    x (tip,list)
    flag = input('您是否想要添加一条车票信息？(y/n)')
    print(flag)
    if flag!='y' and flag!='Y':
        break
    newlist=[]
    n1 = input('请输入车次：')
    n2 = input('请输入出发站：')
    n3 = input('请输入到达站：')
    n4 = input('请输入出发时间：')
    n5 = input('请输入到达时间：')
    n6 = input('请输入历时：')
    newlist.append(n1)
    newlist.append(n2)
    newlist.append(n3)
    newlist.append(n4)
    newlist.append(n5)
    newlist.append(n6)
    newlist = tuple(newlist)
    list.append(newlist)